﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Linq;
using System.Linq.Mapping;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;

namespace NewsInfo
{
    public partial class NewsInfo : INotifyPropertyChanging, INotifyPropertyChanged
    {

        private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);

        private int _NewsID;

        private string _NewsTitle;

        private string _NewsData;

        private System.DateTime _NewsDate;

        private string _NewsImageUrl;

        private NewsCatgory.NewsCatgoryType _NewsCategory;

        #region Extensibility Method Definitions
        partial void OnLoaded();
        partial void OnValidate(System.Linq.ChangeAction action);
        partial void OnCreated();
        partial void OnNewsIDChanging(int value);
        partial void OnNewsIDChanged();
        partial void OnNewsTitleChanging(string value);
        partial void OnNewsTitleChanged();
        partial void OnNewsDataChanging(string value);
        partial void OnNewsDataChanged();
        partial void OnNewsDateChanging(System.DateTime value);
        partial void OnNewsDateChanged();
        partial void OnNewsImageUrlChanging(string value);
        partial void OnNewsImageUrlChanged();
        partial void OnNewsCategoryChanging(NewsCatgory.NewsCatgoryType value);
        partial void OnNewsCategoryChanged();
        #endregion

        public NewsInfo()
        {
            OnCreated();
        }

        public int NewsID
        {
            get
            {
                return this._NewsID;
            }
            set
            {
                if ((this._NewsID != value))
                {
                    this.OnNewsIDChanging(value);
                    this.SendPropertyChanging();
                    this._NewsID = value;
                    this.SendPropertyChanged("NewsID");
                    this.OnNewsIDChanged();
                }
            }
        }

        public string NewsTitle
        {
            get
            {
                return this._NewsTitle;
            }
            set
            {
                if ((this._NewsTitle != value))
                {
                    this.OnNewsTitleChanging(value);
                    this.SendPropertyChanging();
                    this._NewsTitle = value;
                    this.SendPropertyChanged("NewsTitle");
                    this.OnNewsTitleChanged();
                }
            }
        }

        public string NewsData
        {
            get
            {
                return this._NewsData;
            }
            set
            {
                if ((this._NewsData != value))
                {
                    this.OnNewsDataChanging(value);
                    this.SendPropertyChanging();
                    this._NewsData = value;
                    this.SendPropertyChanged("NewsData");
                    this.OnNewsDataChanged();
                }
            }
        }

        public System.DateTime NewsDate
        {
            get
            {
                return this._NewsDate;
            }
            set
            {
                if ((this._NewsDate != value))
                {
                    this.OnNewsDateChanging(value);
                    this.SendPropertyChanging();
                    this._NewsDate = value;
                    this.SendPropertyChanged("NewsDate");
                    this.OnNewsDateChanged();
                }
            }
        }

        public string NewsImageUrl
        {
            get
            {
                return this._NewsImageUrl;
            }
            set
            {
                if ((this._NewsImageUrl != value))
                {
                    this.OnNewsImageUrlChanging(value);
                    this.SendPropertyChanging();
                    this._NewsImageUrl = value;
                    this.SendPropertyChanged("NewsImageUrl");
                    this.OnNewsImageUrlChanged();
                }
            }
        }

        public NewsCatgory.NewsCatgoryType NewsCategory
        {
            get
            {
                return this._NewsCategory;
            }
            set
            {
                if ((this._NewsCategory != value))
                {
                    this.OnNewsCategoryChanging(value);
                    this.SendPropertyChanging();
                    this._NewsCategory = value;
                    this.SendPropertyChanged("NewsCategory");
                    this.OnNewsCategoryChanged();
                }
            }
        }

        public event PropertyChangingEventHandler PropertyChanging;

        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void SendPropertyChanging()
        {
            if ((this.PropertyChanging != null))
            {
                this.PropertyChanging(this, emptyChangingEventArgs);
            }
        }

        protected virtual void SendPropertyChanged(String propertyName)
        {
            if ((this.PropertyChanged != null))
            {
                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
}
